import request from './request'
// -------------关于无人船巡航控制的接口-------------
// 点击与无人船连接
export function linkShip() {
    return request({
        url: '/send',
        method: "get"
    })
}

// 点击与无人船断开连接不再接收
export function breakLinkShip() {
    return request({
        url: '/send',
        method: "post"
    })
}
// 修改无人船模式状态
export function changeControlModel(mode) {
    return request({
        url: '/updateCurrentState?state=' + mode,
        method: "get"
    })
}

// 手动遥控状态下的记录开启按钮
export function openTheRecord(check) {
    return request({
        url: '/updateStartRecord?startRecord=' + check,
        method: "get"
    })
}

// 获取水上障碍物距离
export function getAboveWater() {
    return request({
        url: '/getDeviation',
        method: "get"
    })
}

// 获取水下障碍物距离
export function getUnderWater() {
    return request({
        url: '/getDeviation',
        method: "get"
    })
}

// 获取姿态角
export function getAngle() {
    return request({
        url: '/getAngle',
        method: "get"
    })
}

// 开启定时器获取到无人船位置Position，更新地图的中心点
export function getShipPosition() {
    return request({
        url: '/GetGps',
        method: "get"
    })
}

// 船移动按钮
export function moveTheShip(order) {
    return request({
        url: '/move?requestParam=' + order,
        method: "get"
    })
}
// 船停止按钮
export function stopTheShip() {
    return request({
        url: '/move?requestParam=stop',
        method: "get"
    })
}
// 取水按钮
export function getWaterQuality() {
    return request({
        url: '/getWaterQuality',
        method: "get"
    })
}
// 自动巡航：执行某个计划
export function executePlan(planId) {
    return request({
        url: '/ExecutePlan?planid=' + planId,
        method: "get"
    })
}

// 深度调节
export function depthControl(type) {
    let T = type ? 'up' : 'down';
    return request({
        url: '/sampling?requestParam=' + T,
        method: "get"
    })
}




